
    //检查登录 获取缓存

    checkLogin();
    var worker = getCache(login_key);

    var  info_list;
    var name ;
    var success = function(res){
        info_list = res;
         name = info_list.data.name;
        template.defaults.imports.worker_bindwx = worker_bindwx+'?wid='+worker.wid+'&sid='+worker.sid+'&aid='+worker.aid;

        var html = template('center_container',info_list);
        document.getElementById('content_box').innerHTML = html;

        var html = template('list_container',info_list);
        document.getElementById('list_block').innerHTML = html;

        $('#remove-bindwx').bind('click',function(){
           var success = function(res){
               deleteCache(worker.openid);
                    var success = function (res) {
                        info_list = res;
                        name = info_list.data.name;
                        var html = template('center_container',info_list);
                        document.getElementById('content_box').innerHTML = html;

                        var html = template('list_container',info_list);
                        document.getElementById('list_block').innerHTML = html;
                        return
                    }
               getData(worker_info, {wid:worker.wid,sid:worker.sid,aid:worker.aid}, success);

           } ;
            getData(worker_remove_bindwx, {wid:worker.wid,sid:worker.sid,aid:worker.aid}, success);
        })
    };
    getData(worker_info, {wid:worker.wid,sid:worker.sid,aid:worker.aid}, success);

    function logout() {
        deleteCache(login_key);
        redirect('login.html');
    }


    $('#dingdan').click(function (event) {
        redirect('order-list.html');
        // $(this).find('#dingdan_img').attr('src', './image/dingdan-active.png');
        $(this).find('#daoke_img').attr('src', './image/daoke.png');
        $(this).find('#wode_img').attr('src', './image/wode.png');

        return false;
    });
    $('#daoke').click(function (event) {
        redirect('import.html');
        $(this).find('#dingdan_img').attr('src', './image/dingdan.png');
        // $(this).find('#daoke_img').attr('src', './image/daoke-active.png');
        $(this).find('#wode_img').attr('src', './image/wode.png');
        return false;
    });
    $('#wode').click(function (event) {
        redirect('center.html');
        $(this).find('#dingdan_img').attr('src', './image/dingdan.png');
        $(this).find('#daoke_img').attr('src', './image/daoke.png');
        // $(this).find('#wode_img').attr('src', './image/wode-active.png');
        return false;
    });
